package com.zr.model;

// Generated 2017-7-7 18:10:30 by Hibernate Tools 4.0.0



import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * Car generated by hbm2java
 */
@Entity
@Table(name = "car", catalog = "lms")
public class Car implements java.io.Serializable {

	private Integer carId;
	private Deliverypoint deliverypoint;
	private String carName;
	private String carType;
	private String carState;
	private Integer carMaxWeight;
	private String carNumber;
	private Set<Deliveryreceitp> deliveryreceitps = new HashSet<Deliveryreceitp>(0);

	public Car() {
	}

	public Car(Deliverypoint deliverypoint, String carName, String carType, String carState, Integer carMaxWeight,
			String carNumber, Set<Deliveryreceitp> deliveryreceitps) {
		this.deliverypoint = deliverypoint;
		this.carName = carName;
		this.carType = carType;
		this.carState = carState;
		this.carMaxWeight = carMaxWeight;
		this.carNumber = carNumber;
		this.deliveryreceitps = deliveryreceitps;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)

	@Column(name = "carId", unique = true, nullable = false)
	public Integer getCarId() {
		return this.carId;
	}

	public void setCarId(Integer carId) {
		this.carId = carId;
	}

	@ManyToOne(fetch = FetchType.EAGER)
	@JoinColumn(name = "dpId")
	public Deliverypoint getDeliverypoint() {
		return this.deliverypoint;
	}

	public void setDeliverypoint(Deliverypoint deliverypoint) {
		this.deliverypoint = deliverypoint;
	}

	@Column(name = "carName")
	public String getCarName() {
		return this.carName;
	}

	public void setCarName(String carName) {
		this.carName = carName;
	}

	@Column(name = "carType")
	public String getCarType() {
		return this.carType;
	}

	public void setCarType(String carType) {
		this.carType = carType;
	}

	@Column(name = "carState")
	public String getCarState() {
		return this.carState;
	}

	public void setCarState(String carState) {
		this.carState = carState;
	}

	@Column(name = "carMaxWeight")
	public Integer getCarMaxWeight() {
		return this.carMaxWeight;
	}

	public void setCarMaxWeight(Integer carMaxWeight) {
		this.carMaxWeight = carMaxWeight;
	}

	@Column(name = "carNumber")
	public String getCarNumber() {
		return this.carNumber;
	}

	public void setCarNumber(String carNumber) {
		this.carNumber = carNumber;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "car")
	public Set<Deliveryreceitp> getDeliveryreceitps() {
		return this.deliveryreceitps;
	}

	public void setDeliveryreceitps(Set<Deliveryreceitp> deliveryreceitps) {
		this.deliveryreceitps = deliveryreceitps;
	}

}
